import { addUserApproveInterface } from '@renderer/types'
import { acceptHMRUpdate, defineStore } from 'pinia'

interface userStoreInterface {
  addUserApproveList: addUserApproveInterface[]
}

export const useUserApproveStore = defineStore('addUserApprove', {
  state: (): userStoreInterface => {
    return {
      addUserApproveList: []
    }
  },
  getters: {
    getUserApproveList: (state) => state.addUserApproveList
  },
  actions: {
    setUserApproveList(list: addUserApproveInterface[]) {
      console.log(list)

      this.addUserApproveList = list
    },
    setUserApproveListItem(value: addUserApproveInterface) {
      this.addUserApproveList.push(value)
    }
  }
})

if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(useUserApproveStore, import.meta.hot))
}
